package com.huiquan.icd.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.huiquan.framework.base.EnhancedBaseDao;
import com.huiquan.icd.domain.IcdDiseaseArticle;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class IcdDiseaseArticleDao extends EnhancedBaseDao<IcdDiseaseArticle> {

	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	public static final String space = "ICD_DISEASE_ARTICLE.";

	public IcdDiseaseArticleDao() {
		super(space);
	}

	public int retrieveSize(Map<String, Object> param) {
		return (Integer) this.object(space + "RETRIEVE_SIZE", param, sqlMapClient);
	}

	@SuppressWarnings("unchecked")
	public List<IcdDiseaseArticle> retrievesList(Map<String, Object> param) {
		return (List<IcdDiseaseArticle>) this.list(space + "RETRIEVE_LIST", param, sqlMapClient);
	}

	
	public void deleteArticle( Long id) {
		Map<String, Object> param = new HashMap<>();
		param.put("id", id);
		update(space + "DELETE_ARTICLE", param, sqlMapClient);
	}
	
	
}
